<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/radardevice/devices/boardInfo.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/radardevice/devices/boardInfo.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'id',
                footer: "Foots",
                cnName: '主板管理',
                name: 'devices/boardInfo',
                url: "/boardInfo/",
                sortName: "updateTime"
            });
            const editFormFields = ref({"deviceNo":"","sendimode":"","gatherInterval":"","heartbeatInterval":"","primaryIP":"","secondaryIP":"","powerMode":"","displaySwitch":"","updateTime":""});
            const editFormOptions = ref([[{"title":"设备编号","field":"deviceNo","disabled":true},
                               {"title":"发送模式","field":"sendimode","type":"number"}],
                              [{"title":"采集间隔","field":"gatherInterval","type":"number"},
                               {"title":"心跳间隔","field":"heartbeatInterval","type":"number"}],
                              [{"title":"主IP","field":"primaryIP","type":"text"},
                               {"title":"副IP","field":"secondaryIP","type":"text"}],
                              [{"dataKey":"powerMode","data":[],"title":"省电模式","field":"powerMode","type":"select"},
                               {"dataKey":"displaySwitch","data":[],"title":"显示开关","field":"displaySwitch","type":"select"}],
                              [{"title":"更新时间","field":"updateTime","disabled":true}]]);
            const searchFormFields = ref({"deviceNo":""});
            const searchFormOptions = ref([[{"title":"设备编号","field":"deviceNo","type":"like"}]]);
            const columns = ref([{field:'id',title:'主键',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'device_id',title:'设备ID',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'deviceNo',showOverflowTooltip:'true',title:'设备编号',type:'string',link:true,width:150,readonly:true,align:'left',sort:true},
                       {field:'sendimode',title:'发送模式',type:'int',width:110,align:'left'},
                       {field:'gatherInterval',title:'采集间隔',type:'int',width:90,align:'left'},
                       {field:'heartbeatInterval',title:'心跳间隔',type:'int',width:120,align:'left'},
                       {field:'softwareVersion',title:'软件版本号',type:'int',width:120,align:'left'},
                       {field:'primaryIP',title:'主IP',type:'string',width:110,align:'left'},
                       {field:'secondaryIP',title:'副IP',type:'string',width:110,align:'left'},
                       {field:'powerMode',title:'省电模式',type:'int',bind:{ key:'powerMode',data:[]},width:90,align:'left'},
                       {field:'displaySwitch',title:'显示开关',type:'int',bind:{ key:'displaySwitch',data:[]},width:90,align:'left'},
                       {field:'solarPower',title:'太阳能电量(V)',type:'decimal',width:120,align:'left'},
                       {field:'solarChargingTime',title:'太阳能充电时间',type:'int',width:120,align:'left'},
                       {field:'updateTime',title:'更新时间',type:'datetime',sort:true,width:150,readonly:true,align:'left',sort:true},
                       {field:'CreateID',title:'设备所属性用户',type:'int',width:120,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
